Environment
# View Environment List
# Test Environment
Request
GET /openapi/environments?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response Example
Details
[
{
"env_name": "dev",
"cluster_id": "0123456789abcdef12345678", # K8s Cluster ID
"namespace": "k8s-fansitest-env-dev", # K8s Namespace
"production": false, # Whether it's a production environment
"registry_id": "630c7ad700430c131062e245", # Image Registry ID
"status": "success", # Environment status, including success(normal), failed(failed), creating(creating), updating(updating), deleting(deleting), unknown(unknown), unstable(unstable), sleeping(sleeping)
"update_by": "admin", # Environment updater
"update_time": 1690186199 # Last update time, Unix timestamp format
},
{
"env_name": "dev5",
"cluster_id": "0123456789abcdef12345678",
"namespace": "ai-test-2-env-dev",
"production": false,
"registry_id": "6350be2b4503905e98b4b771",
"status": "success",
"update_by": "admin",
"update_time": 1690181832
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Production Environment
Request
GET /openapi/environments/production?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response Example
Details
[
{
"env_name": "dev",
"cluster_id": "0123456789abcdef12345678", # K8s Cluster ID
"namespace": "k8s-fansitest-env-dev", # K8s Namespace
"production": true, # Whether it's a production environment
"registry_id": "630c7ad700430c131062e245", # Image Registry ID
"status": "success", # Environment status, including success(normal), failed(failed), creating(creating), updating(updating), deleting(deleting), unknown(unknown), unstable(unstable), sleeping(sleeping)
"update_by": "admin", # Environment updater
"update_time": 1690186199 # Last update time, Unix timestamp format
},
{
"env_name": "dev5",
"cluster_id": "0123456789abcdef12345678",
"namespace": "ai-test-2-env-dev",
"production": true,
"registry_id": "6350be2b4503905e98b4b771",
"status": "success",
"update_by": "admin",
"update_time": 1690181832
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# View Environment Details
Applicable to K8s YAML projects.
# Test Environment
Request
GET /openapi/environments/<environmentKey>?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response Example
Details
{
"project_key": "simple-demo", # Project Key
"env_key": "dev", # Environment Key
"update_by": "admin", # Environment updater
"update_time": 1689933256, # Last update time, Unix timestamp format
"cluster_id": "0123456789abcdef12345678", # K8s Cluster ID
"namespace": "simple-demo-env-dev", # K8s Namespace
"registry_id": "630c7ad700430c131062e245", # Image Registry ID
"global_variables": [ # Global variables list
{
"key": "cpuLimit", # Variable key
"value": "1000m", # Variable value
"type": "string", # Variable type, including string, bool, enum, yaml
"options": [], # Variable options, meaningful when type is enum
"desc": "CPU Resource Limit", # Variable description
"related_services": ["service1"] # Related services
}
],
"services": [ # Services list
{
"service_name": "service2", # Service name
"containers": [ # Service component information
{
"name": "myapp-1", # Service component name
"image": "koderover.tencentcloudcr.com/test/myapp-1:20230721164449-6-main", # Service component image
"image_name": "myapp-1" # Service component image name
}
],
"variable_kvs": [ # Service variables list
{
"key": "env1",
"value": "demo",
"type": "string",
}
],
"status": "running", # Service status, including running(running), unstable(unstable), unstart(not started), failed(failed), pending(pending), unknown(unknown)
"type": "k8s" # Project type, always k8s
}
],
"status": "success" # Environment status, including creating(creating), updating(updating), deleting(deleting), succeeded(normal), error(internal error), running(running), unstable(unstable), sleeping(sleeping), unknown(unknown)
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Production Environment
Request
GET /openapi/environments/production/<environmentName>?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response Example
Details
{
"project_key": "simple-demo", # Project Key
"env_key": "prod", # Environment Key
"env_name":"prod", # Environment Name
"update_by": "admin", # Environment updater
"update_time": 1689933256, # Last update time, Unix timestamp format
"cluster_id": "0123456789abcdef12345678", # K8s Cluster ID
"namespace": "simple-demo-env-prod", # K8s Namespace
"registry_id": "630c7ad700430c131062e245", # Image Registry ID
"global_variables": [ # Global variables list
{
"key": "cpuLimit", # Variable key
"value": "1000m", # Variable value
"type": "string", # Variable type, including string, bool, enum, yaml
"options": [], # Variable options, meaningful when type is enum
"desc": "CPU Resource Limit", # Variable description
"related_services": ["service1"] # Related services
}
],
"services": [ # Services list
{
"service_name": "service2", # Service name
"containers": [ # Service component information
{
"name": "myapp-1", # Service component name
"image": "koderover.tencentcloudcr.com/test/myapp-1:20230721164449-6-main", # Service component image
"image_name": "myapp-1" # Service component image name
}
],
"variable_kvs": [ # Service variables list
{
"key": "env1",
"value": "demo",
"type": "string",
}
],
"status": "running", # Service status, including running(running), unstable(unstable), unstart(not started), failed(failed), pending(pending), unknown(unknown)
"type": "k8s" # Project type, always k8s
}
],
"status": "success" # Environment status, including creating(creating), updating(updating), deleting(deleting), succeeded(normal), error(internal error), running(running), unstable(unstable), sleeping(sleeping), unknown(unknown)
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# View Environment Service Details
Applicable to K8s YAML projects.
# Test Environment
Request
GET /openapi/environments/<environmentKey>/services/<serviceName>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
workLoadtype | Workload Type | string | Yes |
Response Example
Details
{
"service_name": "service1",
"scales": [
{
"name": "service1",
"type": "Deployment",
"images": [
{
"name": "service1",
"image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
"image_name": "service1"
}
],
"pods": [
{
"kind": "ReplicaSet",
"name": "service1-5b94c8f98f-hsqfl",
"status": "Running",
"age": "34d",
"createtime": 1704444315,
"ip": "10.200.2.76",
"labels": {
"app.kubernetes.io/instance": "service1",
"app.kubernetes.io/name": "yaml",
"pod-template-hash": "5b94c8f98f",
"s-product": "yaml",
"s-service": "service1"
},
"containers": [
{
"name": "service1",
"image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
"restart_count": 0,
"status": "running",
"ready": true,
"ports": [
{
"containerPort": 20211,
"protocol": "TCP"
}
],
"message": "",
"reason": "",
"started_at": 1704444316
}
],
"node_name": "172.16.0.46",
"host_ip": "172.16.0.46",
"enable_debug_container": false,
"pod_ready": true,
"containers_ready": true,
"containers_message": ""
}
],
"replicas": 1,
"zadigx_release_type": "",
"zadigx_release_tag": ""
}
],
"ingress": [],
"service_endpoints": [
{
"name": "service1",
"age": "119d",
"labels": {
"app.kubernetes.io/instance": "service1",
"app.kubernetes.io/name": "yaml",
"s-product": "yaml",
"s-service": "service1"
},
"endpoints": [
{
"service_name": "service1",
"service_port": 20211,
"node_port": 30593
}
]
}
],
"cron_jobs": [],
"namespace": "yaml-env-dev",
"env_name": "dev",
"product_name": "yaml",
"group_name": ""
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Production Environment
Request
GET /openapi/environments/production/<environmentKey>/services/<serviceName>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
workLoadtype | Workload Type | string | Yes |
Response Example
Details
{
"service_name": "service1",
"scales": [
{
"name": "service1",
"type": "Deployment",
"images": [
{
"name": "service1",
"image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
"image_name": "service1"
}
],
"pods": [
{
"kind": "ReplicaSet",
"name": "service1-5b94c8f98f-hsqfl",
"status": "Running",
"age": "34d",
"createtime": 1704444315,
"ip": "10.200.2.76",
"labels": {
"app.kubernetes.io/instance": "service1",
"app.kubernetes.io/name": "yaml",
"pod-template-hash": "5b94c8f98f",
"s-product": "yaml",
"s-service": "service1"
},
"containers": [
{
"name": "service1",
"image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
"restart_count": 0,
"status": "running",
"ready": true,
"ports": [
{
"containerPort": 20211,
"protocol": "TCP"
}
],
"message": "",
"reason": "",
"started_at": 1704444316
}
],
"node_name": "172.16.0.46",
"host_ip": "172.16.0.46",
"enable_debug_container": false,
"pod_ready": true,
"containers_ready": true,
"containers_message": ""
}
],
"replicas": 1,
"zadigx_release_type": "",
"zadigx_release_tag": ""
}
],
"ingress": [],
"service_endpoints": [
{
"name": "service1",
"age": "119d",
"labels": {
"app.kubernetes.io/instance": "service1",
"app.kubernetes.io/name": "yaml",
"s-product": "yaml",
"s-service": "service1"
},
"endpoints": [
{
"service_name": "service1",
"service_port": 20211,
"node_port": 30593
}
]
}
],
"cron_jobs": [],
"namespace": "yaml-env-dev",
"env_name": "dev",
"product_name": "yaml",
"group_name": ""
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# View Environment K8S Service Yaml
# Test Environment
Request
GET /openapi/environments/services/yaml
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
envName | Environment Name | string | Yes |
serviceName | Service Name | string | Yes |
Response Example
Details
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: service1
app.kubernetes.io/name: yaml
env: dev
name: service1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: service1
app.kubernetes.io/name: yaml
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: service1
app.kubernetes.io/name: yaml
spec:
containers:
- command:
- /workspace/service1
image: koderover.tencentcloudcr.com/test/service1:20250722141750-112-main
imagePullPolicy: Always
name: service1
ports:
- containerPort: 20221
protocol: TCP
resources: {}
status: {}
---
apiVersion: v1
kind: Service
metadata:
name: service1
labels:
app.kubernetes.io/name: yaml
app.kubernetes.io/instance: service1
spec:
type: NodePort
ports:
- protocol: TCP
port: 20221
targetPort: 20221
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Production Environment
Request
GET /openapi/environments/production/services/yaml
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
envName | Environment Name | string | Yes |
serviceName | Service Name | string | Yes |
Response Example
Details
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: service1
app.kubernetes.io/name: yaml
env: dev
name: service1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: service1
app.kubernetes.io/name: yaml
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: service1
app.kubernetes.io/name: yaml
spec:
containers:
- command:
- /workspace/service1
image: koderover.tencentcloudcr.com/test/service1:20250722141750-112-main
imagePullPolicy: Always
name: service1
ports:
- containerPort: 20221
protocol: TCP
resources: {}
status: {}
---
apiVersion: v1
kind: Service
metadata:
name: service1
labels:
app.kubernetes.io/name: yaml
app.kubernetes.io/instance: service1
spec:
type: NodePort
ports:
- protocol: TCP
port: 20221
targetPort: 20221
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# View Environment Helm Service Values
# Test Environment
Request
GET /openapi/environments/service/values
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
envName | Environment Name | string | Yes |
serviceName | Service Name | string | Yes |
Response Example
Details
a: b
c: d
fullnameOverride: service3
image:
repository: koderover.tencentcloudcr.com/test/service3
tag: 20250711170816-5-lilian01
imagePullSecretsName: default-registry-secret
port: 20223
replicaCount: 4
resources:
limits:
cpu: 20m
mem: 20Mi
requests:
cpu: 10m
mem: 10Mi
x: kk
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Production Environment
Request
GET /openapi/environments/production/service/values
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
envName | Environment Name | string | Yes |
serviceName | Service Name | string | Yes |
Response Example
Details
a: b
c: d
fullnameOverride: service3
image:
repository: koderover.tencentcloudcr.com/test/service3
tag: 20250711170816-5-lilian01
imagePullSecretsName: default-registry-secret
port: 20223
replicaCount: 4
resources:
limits:
cpu: 20m
mem: 20Mi
requests:
cpu: 10m
mem: 10Mi
x: kk
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# New Environment - K8s YAML Project
# Test Environment
Request
POST /openapi/environments?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment Key | string | Yes |
cluster_id | K8s Cluster ID | string | Yes |
namespace | K8s Namespace | string | Yes |
registry_id | Image Registry ID | string | Yes |
env_configs | Environment Configurations | []EnvConfig | No |
global_variables | Global Variables | []GlobalVariable | No |
services | Services | []Service | No |
sub_env | Sub Environment | []SubEnv | No |
SubEnv Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
base_env | Base Environment Name | string | Yes |
enable | Enable Sub Environment | bool | Yes |
EnvConfig Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
yaml_data | Environment Configuration YAML Content | string | Yes |
common_env_cfg_type | Environment Configuration Type | string | Yes |
GlobalVariable Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Variable Key | string | Yes |
value | Variable Value | string | Yes |
Service Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_name | Service Name | string | Yes |
type | Service Type | string | Yes |
containers | Service Images | []Container | Yes |
variable_kvs | Service Variables | []VariableKV | No |
Container Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
image | Full Image Address | string | Yes |
image_name | Image Name | string | Yes |
name | Service Component Name | string | Yes |
VariableKV Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Variable Key | string | Yes |
value | Variable Value | string | Yes |
use_global_variable | Whether to Use Global Variable | bool | Yes |
Body Parameter Example
Details
{
"env_key": "dev7",
"cluster_id": "0123456789abcdef12345678",
"namespace": "ai-test-2-env-dev",
"registry_id": "6350be2b4503905e98b4b771",
"is_public": true,
"global_variables": [
{
"key": "cpuLimit",
"value": "15m"
}
],
"services": [
{
"service_name": "service2",
"type": "k8s",
"containers": [
{
"image": "koderover.tencentcloudcr.com/test/service2:20230730070002-38-main",
"image_name": "service2",
"name": "service2"
}
],
"variable_kvs": [
{
"key": "cpu",
"value": "8m"
},
{
"key":"cpuLimit",
"value":"15m"
}
]
}
],
"env_configs": [
{
"yaml_data": "apiVersion: v1\ndata:\n root-cert.pem: |\n -----BEGIN CERTIFICATE-----\n MIIC/TCCAeWgAwIBAgIRAISZur/+Sm1i2dv4w5qWhy0wDQYJKoZIhvcNAQELBQAw\n GDEWMBQGA1UEChMNY2x1c3Rlci5sb2NhbDAeFw0yMjA4MTUwMjM5MTdaFw0zMjA4\n MTIwMjM5MTdaMBgxFjAUBgNVBAoTDWNsdXN0ZXIubG9jYWwwggEiMA0GCSqGSIb3\n DQEBAQUAA4IBDwAwggEKAoIBAQDQWPcRpknooTvvR8rg9XOXtOV2XyW2mDCBhQ0E\n THTQI17l5UK+AkhifJwUeGcc6KsZvBff7ksf5eQ6e1XBkwhEFTn0QBNTQwzVH/gz\n dVLB/SYgDKZyUBq3N2E0V1tYsrXE/Mc5qRcnBwscAdOcH5gpW3ZxfRUr7t40DY0H\n Im8RIajIB7UyT9lo+unaPozF5AuIN4ylv6XGcO1voXimCXNg5r2T/ATTA/vqJcS2\n ZlaT/85+cZCycu8ZwZaVNgxlyjE1CgUBEdMxy0svMXpJvDondEZEPfZVuB1X2FUL\n fczThsA7XmBvBYKXoKD7cAGlJS1I2nkfxXk+dkN+tolDQA6NAgMBAAGjQjBAMA4G\n A1UdDwEB/wQEAwICBDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS1JbJ810a/\n +KEqd78PtqTKRu+iqDANBgkqhkiG9w0BAQsFAAOCAQEAy833M/pdnLkKmZK9NaTp\n Ten5TQdxhRlPuG3dBfU45VXQ0IhgO7Er0caPagMaVPkqdfuUcd5sT5lfEiJUtt3B\n bOhyPK09GkD7muhO7Bx1o+qAPXkCjf0JRcAgQcpZ5va72V6bB8CJ5+6YoQV4eQGa\n mF80vbzPx3zR6At+3JAZaMhbXItBWJi5ULIGMaJ3JRUvqBMG1jsZdeqOa/fTjVc1\n 6gdX/O9eZjfRdnUiBv4kCD00nr74crXfvAmQGDX/EbNqYGLNHqAdqRgibUYowvEC\n 9gaZfvKU4lOaWYnwE4RlJ1Q6uhVgH45fFiq8pAeflSh56TLbjRfi/VM2lg3GN+cm\n 6g==\n -----END CERTIFICATE-----\nkind: ConfigMap\nmetadata:\n creationTimestamp: \"2023-07-06T08:01:16Z\"\n labels:\n istio.io/config: \"true\"\n name: istio-ca-root-cert-test\n namespace: ai-test-2-env-dev\n selfLink: /api/v1/namespaces/ai-test-2-env-dev/configmaps/istio-ca-root-cert\n uid: 767723b1-8bb2-4c51-92fd-d224bf0c0dc5\n",
"common_env_cfg_type": "ConfigMap"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Response
{
"message": "success"
}
2
3
# Production Environment
Request
POST /openapi/environments/production?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment Key | string | Yes |
env_name | Environment Name | string | No |
cluster_id | K8s Cluster ID | string | Yes |
namespace | K8s Namespace | string | Yes |
registry_id | Image Registry ID | string | Yes |
sub_env | Sub Environment | []SubEnv | No |
SubEnv Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
base_env | Base Environment Name | string | Yes |
enable | Enable Sub Environment | bool | Yes |
Response
{
"message": "success"
}
2
3
# Edit Environment
Applicable to K8s YAML projects.
# Test Environment
Request
PUT /openapi/environments/<environmentKey>?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
registry_id | Image Registry ID | string | Yes |
Response
{
"message": "success"
}
2
3
# Production Environment
Request
PUT /openapi/environments/production/<environmentKey>?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
registry_id | Image Registry ID | string | No |
env_name | Environment Name | string | No |
Response
{
"message": "success"
}
2
3
# Delete Environment
Applicable to K8s YAML projects.
# Test Environment
Request
DELETE /openapi/environments/<environmentKey>?projectKey=<projectKey>&isDelete=true
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
isDelete | Whether to delete the corresponding K8s namespace and services | bool | Yes |
Response
{
"message": "success"
}
2
3
# Production Environment
Request
DELETE /openapi/environments/production/<environmentKey>?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response
{
"message": "success"
}
2
3
# Add Service - K8s YAML Project
# Test Environment
Request
POST /openapi/environments/service/yaml?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment Key | string | Yes |
service_list | Services to Add to Environment | []Service | Yes |
Service Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_name | Service Name | string | Yes |
variable_kvs | Service Variables | []VariableKV | No |
Body Parameter Example
Details
{
"env_key": "dev",
"service_list": [
{
"service_name": "service2",
"variable_kvs": [
{
"key": "cpuLimit",
"use_global_variable":true
},
{
"key": "port",
"value": "20221"
}
]
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Response
{
"message": "success"
}
2
3
# Production Environment
Request
POST /openapi/environments/production/service/yaml?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment Key | string | Yes |
service_list | Services to Add to Environment | []Service | Yes |
Service Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_name | Service Name | string | Yes |
variable_kvs | Service Variables | []VariableKV | No |
VariableKV Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Variable Key | string | Yes |
value | Variable Value | string | Yes |
use_global_variable | Whether to Use Global Variable | bool | Yes |
Body Parameter Example
Details
{
"env_key": "dev",
"service_list": [
{
"service_name": "service2",
"variable_kvs": [
{
"key": "cpuLimit",
"use_global_variable":true
},
{
"key": "port",
"value": "20221"
}
]
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Response
{
"message": "success"
}
2
3
# Update Service
Applicable to K8s YAML projects.
# Test Environment
Request
PUT /openapi/environments/<environmentKey>/services?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_list | Service Variables | []Service | Yes |
Service Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_name | Service Name | string | Yes |
variable_kvs | Service Variables | []VariableKV | No |
Body Parameter Example
Details
{
"service_list": [
{
"service_name": "service2",
"variable_kvs": [
{
"key": "cpu",
"value": "4m",
"use_global_variable":true
}
]
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
Response
{
"message": "success"
}
2
3
# Production Environment
Request
PUT /openapi/environments/production/<environmentKey>/services?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_list | Service Variables | []Service | Yes |
Service Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_name | Service Name | string | Yes |
variable_kvs | Service Variables | []VariableKV | No |
Body Parameter Example
Details
{
"service_list": [
{
"service_name": "service2",
"variable_kvs": [
{
"key": "cpu",
"value": "4m",
"use_global_variable":true
}
]
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
Response
{
"message": "success"
}
2
3
# Delete Service
Applicable to K8s YAML projects.
# Test Environment
Request
DELETE /openapi/environments/service/yaml?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment Key | string | Yes |
service_names | Services to Delete | []string | Yes |
not_delete_resource | Whether to not Delete K8S Resources | bool | No |
Response
{
"message": "success"
}
2
3
# Production Environment
Request
DELETE /openapi/environments/production/service/yaml?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment Key | string | Yes |
service_names | Services to Delete | []string | Yes |
not_delete_resource | Whether to not Delete K8S Resources | bool | No |
Response
{
"message": "success"
}
2
3
# View Global Variables
Applicable to K8s YAML projects.
# Test Environment
Request
GET /openapi/environments/<environmentKey>/variable?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response Example
Details
[
{
"key": "cpuLimit", # Global variable key
"value": "1000m", # Global variable value
"type": "string", # Global variable type, including string, bool, yaml, enum
"options": [], # Variable options, meaningful when type is enum
"desc": "CPU Limit", # Global variable description
"related_services": ["service1", "service2"] # Related services
}
]
2
3
4
5
6
7
8
9
10
# Production Environment
Request
GET /openapi/environments/production/<environmentKey>/variable?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response Example
Details
[
{
"key": "cpuLimit", # Global variable key
"value": "1000m", # Global variable value
"type": "string", # Global variable type, including string, bool, yaml, enum
"options": [], # Variable options, meaningful when type is enum
"desc": "CPU Limit", # Global variable description
"related_services": ["service1", "service2"] # Related services
}
]
2
3
4
5
6
7
8
9
10
# Update Global Variables
Tip
- Applicable to K8s YAML projects.
- After updating global variables, related services will be updated synchronously.
# Test Environment
Request
PUT /openapi/environments/<environmentKey>/variable?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
global_variables | Global Variables to Update | []VariableKV | Yes |
VariableKV Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Variable Key | string | Yes |
value | Variable Value | string | Yes |
Response
{
"message": "success"
}
2
3
# Production Environment
Request
PUT /openapi/environments/production/<environmentKey>/variable?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
global_variables | Global Variables to Update | []VariableKV | Yes |
VariableKV Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Variable Key | string | Yes |
value | Variable Value | string | Yes |
Response
{
"message": "success"
}
2
3
# Add Environment Configuration
Applicable to K8s YAML projects.
# Test Environment
Request
POST /openapi/environments/<environmentKey>/envcfgs?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
name | Environment Configuration Name | string | Yes |
common_env_cfg_type | Environment Configuration Type | string | Yes |
yaml_data | Environment Configuration Content | string | Yes |
Body Example
Details
{
"name": "game-demo",
"common_env_cfg_type": "ConfigMap",
"yaml_data": "apiVersion: v1\ndata:\n root-cert.pem: |\n -----BEGIN CERTIFICATE-----\n MIIC/TCCAeWgAwIBAgIRAISZur/+Sm1i2dv4w5qWhy0wDQYJKoZIhvcNAQELBQAw\n GDEWMBQGA1UEChMNY2x1c3Rlci5sb2NhbDAeFw0yMjA4MTUwMjM5MTdaFw0zMjA4\n MTIwMjM5MTdaMBgxFjAUBgNVBAoTDWNsdXN0ZXIubG9jYWwwggEiMA0GCSqGSIb3\n DQEBAQUAA4IBDwAwggEKAoIBAQDQWPcRpknooTvvR8rg9XOXtOV2XyW2mDCBhQ0E\n THTQI17l5UK+AkhifJwUeGcc6KsZvBff7ksf5eQ6e1XBkwhEFTn0QBNTQwzVH/gz\n dVLB/SYgDKZyUBq3N2E0V1tYsrXE/Mc5qRcnBwscAdOcH5gpW3ZxfRUr7t40DY0H\n Im8RIajIB7UyT9lo+unaPozF5AuIN4ylv6XGcO1voXimCXNg5r2T/ATTA/vqJcS2\n ZlaT/85+cZCycu8ZwZaVNgxlyjE1CgUBEdMxy0svMXpJvDondEZEPfZVuB1X2FUL\n fczThsA7XmBvBYKXoKD7cAGlJS1I2nkfxXk+dkN+tolDQA6NAgMBAAGjQjBAMA4G\n A1UdDwEB/wQEAwICBDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS1JbJ810a/\n +KEqd78PtqTKRu+iqDANBgkqhkiG9w0BAQsFAAOCAQEAy833M/pdnLkKmZK9NaTp\n Ten5TQdxhRlPuG3dBfU45VXQ0IhgO7Er0caPagMaVPkqdfuUcd5sT5lfEiJUtt3B\n bOhyPK09GkD7muhO7Bx1o+qAPXkCjf0JRcAgQcpZ5va72V6bB8CJ5+6YoQV4eQGa\n mF80vbzPx3zR6At+3JAZaMhbXItBWJi5ULIGMaJ3JRUvqBMG1jsZdeqOa/fTjVc1\n 6gdX/O9eZjfRdnUiBv4kCD00nr74crXfvAmQGDX/EbNqYGLNHqAdqRgibUYowvEC\n 9gaZfvKU4lOaWYnwE4RlJ1Q6uhVgH45fFiq8pAeflSh56TLbjRfi/VM2lg3GN+cm\n 6g==\n -----END CERTIFICATE-----\nkind: ConfigMap\nmetadata:\n creationTimestamp: \"2023-07-06T08:01:16Z\"\n labels:\n istio.io/config: \"true\"\n name: istio-ca-root-cert-test\n namespace: ai-test-2-env-dev\n selfLink: /api/v1/namespaces/ai-test-2-env-dev/configmaps/istio-ca-root-cert\n uid: 767723b1-8bb2-4c51-92fd-d224bf0c0dc5\n",
"common_env_cfg_type": "ConfigMap"
}
]
}
2
3
4
5
6
7
8
Response
{
"message": "success"
}
2
3
# Production Environment
Request
POST /openapi/environments/production/<environmentKey>/envcfgs?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
name | Environment Configuration Name | string | Yes |
common_env_cfg_type | Environment Configuration Type | string | Yes |
yaml_data | Environment Configuration Content | string | Yes |
Body Example
Details
{
"name": "game-demo",
"common_env_cfg_type": "ConfigMap",
"yaml_data": "apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: game-demo\ndata:\n player_initial_lives: \"3\"\n ui_properties_file_name: \"user-interface.properties\"\n\n game.properties: |\n enemy.types=aliens,monsters\n player.maximum-lives=25 \n user-interface.properties: |\n color.good=purple\n color.bad=yellow\n allow.textmode=true "
}
2
3
4
5
Response
{
"message": "success"
}
2
3
# View Environment Configuration List
Applicable to K8s YAML projects.
# Test Environment
Request
GET /openapi/environments/<environmentKey>/envcfgs?projectKey=<projectKey>&type=<environment configuration type>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
type | Environment Configuration Type | string | Yes |
Response Example
Details
[
{
"name": "game-demo", # Environment configuration name
"env_name": "dev", # Environment name
"project_name": "simple-demo", # Project key
"common_env_cfg_type": "ConfigMap", # Environment configuration type
},
{
"name": "istio-ca-root-cert",
"env_name": "dev",
"project_name": "simple-demo",
"common_env_cfg_type": "ConfigMap",
"update_time": 1687259964
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Production Environment
Request
GET /openapi/environments/production/<environmentKey>/envcfgs?projectKey=<projectKey>&type=<environment configuration type>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
type | Environment Configuration Type | string | Yes |
Response Example
Details
[
{
"name": "game-demo", # Environment configuration name
"env_name": "dev", # Environment name
"project_name": "simple-demo", # Project key
"common_env_cfg_type": "ConfigMap", # Environment configuration type
},
{
"name": "istio-ca-root-cert",
"env_name": "dev",
"project_name": "simple-demo",
"common_env_cfg_type": "ConfigMap",
"update_time": 1687259964
}
]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# View Environment Configuration Details
Applicable to K8s YAML projects.
# Test Environment
Request
GET /openapi/environments/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
type | Environment Configuration Type | string | Yes |
Response Example
Manually entered environment configuration example
{
"configMap_detail": { // configMap environment configuration resource details, for other resource types the key here is: ingress_detail, secret_detail, pvc_detail
"name": "istio-ca-root-cert", # Environment configuration name
"common_env_cfg_type": "ConfigMap", # Environment configuration type
"created_time": 1686225615, # Environment configuration creation time, Unix timestamp format
"env_key": "dev", # Environment key
"product_key": "simple-demo", # Project key
"yaml_data": ".......", # Environment configuration YAML content, string format
"source_detail": { # Code repository configuration, this field has information when environment configuration is imported from code repository
"git_repo_config": {
"codehost_key": "kr-test", # Code source key
"namespace": "kr-test-org1", # Organization name/username
"owner": "kr-test-org1", # Code repository owner
"repo": "config-data", # Code repository
"branch": "main", # Code branch
},
"load_path": "cm.yaml", # File path
"auto_sync": true # Auto sync switch
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Production Environment
Request
GET /openapi/environments/production/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
type | Environment Configuration Type | string | Yes |
Response Example
Manually entered environment configuration example
{
"configMap_detail": { // configMap environment configuration resource details, for other resource types the key here is: ingress_detail, secret_detail, pvc_detail
"name": "istio-ca-root-cert", # Environment configuration name
"common_env_cfg_type": "ConfigMap", # Environment configuration type
"created_time": 1686225615, # Environment configuration creation time, Unix timestamp format
"env_key": "dev", # Environment key
"product_key": "simple-demo", # Project key
"yaml_data": ".......", # Environment configuration YAML content, string format
"source_detail": { # Code repository configuration, this field has information when environment configuration is imported from code repository
"git_repo_config": {
"codehost_key": "kr-test", # Code source key
"namespace": "kr-test-org1", # Organization name/username
"owner": "kr-test-org1", # Code repository owner
"repo": "config-data", # Code repository
"branch": "main", # Code branch
},
"load_path": "cm.yaml", # File path
"auto_sync": true # Auto sync switch
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Update Environment Configuration
Applicable to K8s YAML projects.
Request
PUT /openapi/environments/envcfgs?projectKey=<projectKey>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
name | Environment Configuration Name | string | Yes |
env_key | Environment Key | string | Yes |
common_env_cfg_type | Environment Configuration Type | string | Yes |
yaml_data | Environment Configuration Content | string | Yes |
Body Parameter Example
Details
{
"name":"game-demo",
"env_key":"dev",
"common_env_cfg_type":"ConfigMap",
"yaml_data": "apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: game-demo\ndata:\n player_initial_lives: \"3\"\n ui_properties_file_name: \"user-interface.properties\"\n\n game.properties: |\n enemy.types=aliens,monsters\n player.maximum-lives=25 \n user-interface.properties: |\n color.good=purple\n color.bad=yellow\n allow.textmode=true "
}
2
3
4
5
6
Response
{
"message": "success"
}
2
3
# Delete Environment Configuration
Applicable to K8s YAML projects.
# Test Environment
# Request
DELETE /openapi/environments/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
# Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
type | Environment Configuration Type | string | Yes |
# Response
{
"message": 200
}
2
3
# Production Environment
# Request
DELETE /openapi/environments/production/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
# Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
type | Environment Configuration Type | string | Yes |
# Response
{
"message": 200
}
2
3
# Adjust Service Instance Replica Count
# Request
POST /openapi/environments/scale
# Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
project_key | Project Key | string | Yes |
env_key | Environment Name | string | Yes |
workload_name | Service Instance Name | string | Yes |
workload_type | Service Instance Type | string | Yes |
target_replicas | Target Replica Count | int | Yes |
# Body Parameter Example
Adjust the microservice-demo project, set the backend service replica count to 3 in the dev environment:
{
"project_key": "microservice-demo",
"env_key": "dev",
"workload_name": "backend",
"workload_type": "Deployment",
"target_replicas": 3
}
2
3
4
5
6
7
# Response
{
"message": "success"
}
2
3
# Restart Service Instance
# Test Environment
# Request
POST /openapi/environments/<environmentKey>/service/<serviceName>/restart?projectKey=<projectKey>
# Response
{
"message": "success"
}
2
3
# Production Environment
# Request
POST /openapi/environments/production/<environmentKey>/service/<serviceName>/restart?projectKey=<projectKey>
# Response
{
"message": "success"
}
2
3
# Update Image
# Update Deployment Image
# Request
POST /openapi/environments/image/deployment/<environmentKey>
# Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
product_name | Project Key | string | Yes |
env_name | Environment Name | string | Yes |
service_name | Service Name | string | Yes |
name | Deployment Name | string | Yes |
container_name | Container Name | string | Yes |
image | Image | string | Yes |
# Body Parameter Example
{
"product_name":"patrick-dev1-k8s-1",
"service_name":"service1",
"container_name":"service1",
"name":"service1",
"image":"koderover.tencentcloudcr.com/test/service1:20231116105254-6-main",
"env_name":"dev2"
}
2
3
4
5
6
7
8
# Response
{
"message": "success"
}
2
3
# Update Statefulset Image
# Request
POST /openapi/environments/image/statefulset/<environmentKey>
# Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
product_name | Project Key | string | Yes |
env_name | Environment Name | string | Yes |
service_name | Service Name | string | Yes |
name | Deployment Name | string | Yes |
container_name | Container Name | string | Yes |
image | Image | string | Yes |
# Body Parameter Example
{
"product_name":"patrick-dev1-k8s-1",
"service_name":"service1",
"container_name":"service1",
"name":"service1",
"image":"koderover.tencentcloudcr.com/test/service1:20231116105254-6-main",
"env_name":"dev2"
}
2
3
4
5
6
7
8
# Response
{
"message": "success"
}
2
3
# Update Cronjob Image
# Request
POST /openapi/environments/image/cronjob/<environmentKey>
# Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
product_name | Project Key | string | Yes |
env_name | Environment Name | string | Yes |
service_name | Service Name | string | Yes |
name | Deployment Name | string | Yes |
container_name | Container Name | string | Yes |
image | Image | string | Yes |
# Body Parameter Example
{
"product_name":"patrick-dev1-k8s-1",
"service_name":"service1",
"container_name":"service1",
"name":"service1",
"image":"koderover.tencentcloudcr.com/test/service1:20231116105254-6-main",
"env_name":"dev2"
}
2
3
4
5
6
7
8
# Response
{
"message": "success"
}
2
3
# List Events
# Request
GET /openapi/environments/kube/events
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
envName | Environment Name | string | Yes |
name | involvedObject Name | string | Yes |
type | involvedObject Type | string | Yes |
# Response
Details
{
[
{
"reason": "ScalingReplicaSet",
"message": "Scaled up replica set service1-7cc994479d to 1",
"first_seen": 1707396095,
"last_seen": 1707396095,
"count": 1,
"type": "Normal"
},
{
"reason": "ScalingReplicaSet",
"message": "Scaled down replica set service1-67455dd499 to 0",
"first_seen": 1707396102,
"last_seen": 1707396102,
"count": 1,
"type": "Normal"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Sub Environment
# Check Workload's K8S Service
# Request
GET /openapi/environments/<environmentKey>/check/workloads/k8sservices
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
# Response
Details
["service2.Deployment","service1.Deployment"]
# Enable Sub Environment
# Request
POST /openapi/environments/<environmentKey>/share/enable
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
# Response
{
"message": "success"
}
2
3
# Disable Sub Environment
# Request
DELETE /openapi/environments/<environmentKey>/share/enable
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
# Response
{
"message": "success"
}
2
3
# Check Sub Environment Ready
# Request
GET /openapi/environments/:name/check/sharenv/:op/ready
Path Parameters
| Parameter Name | Type | Description | Required | Default Value |
|---|---|---|---|---|
name | string | Environment Name | Yes | None |
op | string | Operation Type | Yes | None |
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
# Response
Details
{
"is_ready": true,
"checks": {
"namespace_has_istio_label": false,
"virtualservice_deployed": false,
"pods_have_istio_proxy": false,
"workloads_ready": true,
"workloads_have_k8s_service": true
}
}
2
3
4
5
6
7
8
9
10
# Get Entry Service
# Request
GET /openapi/environments/:name/share/portal/:serviceName
Path Parameters
| Parameter Name | Type | Description | Required | Default Value |
|---|---|---|---|---|
name | string | Environment Name | Yes | None |
serviceName | string | Service Name | Yes | None |
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Response
Details
{
"default_gateway_address": "81.69.166.47",
"servers": [
{
"host": "zcms-a-b1.8slan.com",
"port_number": 80,
"port_protocol": "HTTP"
},
{
"host": "a.zicemoshi-helm-env-dev",
"port_number": 80,
"port_protocol": "HTTP"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Set Entry Service
# Request
POST /openapi/environments/:name/share/portal/:serviceName
Path Parameters
| Parameter Name | Type | Description | Required | Default Value |
|---|---|---|---|---|
name | string | Environment Name | Yes | None |
serviceName | string | Service Name | Yes | None |
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
Body Parameters
| Type | Required |
|---|---|
| []OpenAPISetPortalServiceRequest | Yes |
OpenAPISetPortalServiceRequest Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
host | Default gateway address, possibly ip or domain name | string | Yes |
port_number | Port number | uint32 | Yes |
port_protocol | Port protocol | string | Yes |
Body Example
Details
[
{
"host": "zcms-a-b1.8slan.com",
"port_number": 80,
"port_protocol": "HTTP"
},
{
"host": "a.zicemoshi-helm-env-dev",
"port_number": 80,
"port_protocol": "HTTP"
}
]
2
3
4
5
6
7
8
9
10
11
12
Response
{
"message": "success"
}
2
3
# View Container Real-Time Logs
Request
GET /openapi/logs/sse/pods/<pod name>/containers/<container name>
Query Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
projectKey | Project Key | string | Yes |
envName | Environment Name | string | Yes |
tails | Log tail line count | string | Yes |
Response Example
Details
This interface returns an SSE stream, and the returned data format is as follows:
"log message"
# New Environment - Helm Chart Project
Request
POST /openapi/environments/helm?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_name | Environment Key | string | Yes |
alias | Environment Name | string | No |
cluster_id | K8s Cluster ID | string | Yes |
namespace | K8s Namespace | string | Yes |
registry_id | Image Registry ID | string | Yes |
project_key | Project Key | string | Yes |
production | Is Production Environment | bool | No |
sub_env | Sub Environment | []SubEnv | No |
SubEnv Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
base_env | Base Environment Name | string | Yes |
enable | Enable Sub Environment | bool | Yes |
Body Example
Details
{
"alias": "dev3-api",
"cluster_id": "0123456789abcdef12345678",
"env_name": "dev3",
"namespace": "zicemoshi-env-dev3",
"production": false,
"project_key": "zicemoshi",
"registry_id": "683047fe458904519c5f5c80",
"sub_env": {
"base_env": "dev",
"enable": true
}
}
2
3
4
5
6
7
8
9
10
11
12
13
Response
{
"message": "success"
}
2
3
# Add Service - Helm Chart Project
Request
POST /openapi/environments/helm/<environment name>/services?projectKey=<projectKey>
Body Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_name | Environment Key | string | Yes |
production | Is Production Environment | bool | No |
services | Helm Services | []HelmService | Yes |
HelmService Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_name | Service Name | string | Yes |
deploy_strategy | Deployment Strategy, supports import and deploy | string | Yes |
values_yaml | Values YAML Content | string | No |
override_kvs | Override KV Variable List | []OverrideKV | No |
import_values_from_git | Import Values Configuration from Git | ImportValuesFromGit | No |
OverrideKV Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Key | string | Yes |
value | Value | any | Yes |
ImportValuesFromGit Parameters
| Parameter Name | Description | Type | Required |
|---|---|---|---|
codehost_name | Code Source Name | string | Yes |
namespace | Namespace | string | Yes |
repo | Repository Name | string | Yes |
branch | Branch Name | string | Yes |
value_path | Values File Path | string | Yes |
auto_sync | Auto Sync | bool | No |
Body Example
Details
{
"env_name": "api",
"production": false,
"services": [
{
"deploy_strategy": "deploy",
"import_values_from_git": {
"auto_sync": true,
"branch": "patrick-01",
"codehost_name": "gitlab",
"namespace": "kr-test-org1",
"repo": "multi-service-demo",
"value_path": "var.yaml"
},
"override_kvs": [
{
"key": "a",
"value": "b"
}
],
"service_name": "service1",
"values_yaml": "aa: bb\ncc: dd"
},
{
"deploy_strategy": "import",
"override_kvs": [
{
"key": "aa",
"value": "bb"
}
],
"service_name": "service2",
"values_yaml": "abc: 123\ndef: 456"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Response
{
"message": "success"
}
2
3


